import React from 'react'
import { Radio } from 'antd';
import {
    PrinterOutlined,
    LeftOutlined,
} from '@ant-design/icons';

export default function Title(props) {
    const goBack = () => {
        props.goBack && typeof props.goBack === 'function' && props.goBack()
    }

    const PrintBtn = (<Radio.Button value="large" className='buttonloan' style={{ marginTop: 4 }}> <PrinterOutlined /> 打印</Radio.Button>)
    return (
        <div className='nav' style={{
            marginBottom: 10,
            backgroundColor: '#fff'
        }}>
            <span className='title2'>{props.title || '还款详情'}</span>
            <div className='right'>
                {props.isPrintBtn ? PrintBtn : null}
                <div>
                    <Radio.Button value="large" className='buttonloan' onClick={goBack}> <LeftOutlined /> 返回</Radio.Button>
                </div>
            </div>
        </div>
    )
}
